<include file="__THEME__/public_header"/>
<link href="__APP__/friend.css" type="text/css" rel="stylesheet">

<div class="main">
    <include file="_nav"/>
    <div style="float: right;width: 750px;">
<div>共找到{$user1.count}位</div>

        <volist name="user1['data']" id="v">
            <div style="width: 250px;height: 220px;float: left">
                <div style="float: left">
                    <img src=" {$v.head}">
                </div>
                <div style="float: left; margin-left: 20px;margin-top: 10px;">
                    <div>
                        {$v.name}
                    </div>
<div>共有<a onclick="samefriend('{$v.uid}')" class="a">{$v.same_count}</a> 位共同好友</div>
                    <div>
                        {$v.school.0.school_name}

                    </div>
                    <div>

                        {$v.company.0.company}
                    </div>
                    <div>
                        {$v.city}
                    </div>
                    <div>
                        <if condition="$v.isfriend eq 0 ">
                        <a  onclick="addfriend('{$v.uid}')" style="cursor: pointer" >请求加为好友</a>
                            </if>
                    </div>
                </div>

            </div>

        </volist>

<div>{$user1.html}</div>
    </div>


</div>





<include file="__THEME__/public_footer"/>
<script>
    function samefriend(id){
        location.href = U('friend/Index/samefriendList'+'&id='+id);
    }
    function addfriend(fid){
        $.post(U("friend/Index/friend_apply"), {fid:fid}, function (data) {
            if(data.data == 1){
                ui.error('不能添加自己！')
            }
            if(data.status == 1){
                ui.success('消息已经发出！')
            }
            else{
                ui.error('重复添加');
            }
        }, 'json');
    }
</script>